#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <Display/camera.h>
#include <string>
using namespace PhysLeo;
namespace py = pybind11;

void initCameraInterface(py::module &mod)
{
    using class_type = CameraInterface;
    auto pyclass_name = std::string("CameraInterface");
    py::class_<class_type, std::shared_ptr<class_type>>cls(mod, pyclass_name.c_str());

    cls.def("getFov", &class_type::getFov);
    cls.def("getAspect", &class_type::getAspect);
    cls.def("getNearClip", &class_type::getNearClip);
    cls.def("getFarClip", &class_type::getFarClip);
    cls.def("getPosition", &class_type::getPosition);
    cls.def("getUpDirection", &class_type::getUpDirection);
    cls.def("getFocusPosition", &class_type::getFocusPosition);
}

void initCamera(py::module &mod)
{
    initCameraInterface(mod);

    using class_type = Camera;
    using base_type = CameraInterface;
    auto pyclass_name = std::string("Camera");
    py::class_<class_type, base_type, std::shared_ptr<class_type>>cls(mod, pyclass_name.c_str());

    cls.def(py::init());
    cls.def("orbitDown", &class_type::orbitDown);
    cls.def("orbitUp", &class_type::orbitUp);
    cls.def("orbitLeft", &class_type::orbitLeft);
    cls.def("orbitRight", &class_type::orbitRight);
    cls.def("zoomIn", &class_type::zoomIn);
    cls.def("zoomOut", &class_type::zoomOut);
    cls.def("yaw", &class_type::yaw);
    cls.def("pitch", &class_type::pitch);
    cls.def("roll", &class_type::roll);
    cls.def("translateDown", &class_type::translateDown);
    cls.def("translateUp", &class_type::translateUp);
    cls.def("translateLeft", &class_type::translateLeft);
    cls.def("translateRight", &class_type::translateRight);

    cls.def("getFov", &class_type::getFov);
    cls.def("getAspect", &class_type::getAspect);
    cls.def("getNearClip", &class_type::getNearClip);
    cls.def("getFarClip", &class_type::getFarClip);
    cls.def("getPosition", &class_type::getPosition);
    cls.def("getUpDirection", &class_type::getUpDirection);
    cls.def("getFocusPosition", &class_type::getFocusPosition);

    cls.def("setFov", &class_type::setFov);
    cls.def("setAspect", &class_type::setAspect);
    cls.def("setNearClip", &class_type::setNearClip);
    cls.def("setFarClip", &class_type::setFarClip);
    cls.def("setPosition", &class_type::setPosition);
    cls.def("setUpDirection", &class_type::setUpDirection);
    cls.def("setFocusPosition", &class_type::setFocusPosition);
}
